﻿namespace TradePublish
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;
    using TradePublish.Dao;

    public class Statistics : Form
    {
        private Button button1;
        private IContainer components = null;
        private Label label1;
        private Label label10;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;

        public Statistics()
        {
            this.InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.label1.Text = "统计中...";
            this.label2.Text = "统计中...";
            this.label3.Text = "统计中...";
            this.label4.Text = "统计中...";
            this.label5.Text = "统计中...";
            this.statistics();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.label1 = new Label();
            this.label2 = new Label();
            this.label3 = new Label();
            this.label4 = new Label();
            this.label5 = new Label();
            this.label6 = new Label();
            this.label7 = new Label();
            this.label8 = new Label();
            this.label9 = new Label();
            this.label10 = new Label();
            this.button1 = new System.Windows.Forms.Button();
            base.SuspendLayout();
            this.label1.AutoSize = true;
            this.label1.Font = new Font("微软雅黑", 15f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            this.label1.ForeColor = SystemColors.GradientActiveCaption;
            this.label1.Location = new Point(0x93, 0x15);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x45, 0x1b);
            this.label1.TabIndex = 0;
            this.label1.Text = "label1";
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0xa2, 0x3f);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x29, 12);
            this.label2.TabIndex = 1;
            this.label2.Text = "label2";
            this.label3.AutoSize = true;
            this.label3.Location = new Point(0x9f, 0x5e);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x29, 12);
            this.label3.TabIndex = 2;
            this.label3.Text = "label3";
            this.label4.AutoSize = true;
            this.label4.Location = new Point(0x9f, 0x7a);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x29, 12);
            this.label4.TabIndex = 3;
            this.label4.Text = "label4";
            this.label5.AutoSize = true;
            this.label5.Location = new Point(0x9f, 0x9b);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x29, 12);
            this.label5.TabIndex = 4;
            this.label5.Text = "label5";
            this.label6.AutoSize = true;
            this.label6.Location = new Point(0x1c, 0x20);
            this.label6.Name = "label6";
            this.label6.Size = new Size(0x71, 12);
            this.label6.TabIndex = 5;
            this.label6.Text = "当前最新公告期号：";
            this.label7.AutoSize = true;
            this.label7.Location = new Point(0x1f, 0x3f);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x7d, 12);
            this.label7.TabIndex = 6;
            this.label7.Text = "第一类商标总记录数：";
            this.label8.AutoSize = true;
            this.label8.Location = new Point(100, 0x5e);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x35, 12);
            this.label8.TabIndex = 7;
            this.label8.Text = "已采集：";
            this.label9.AutoSize = true;
            this.label9.Location = new Point(100, 0x7a);
            this.label9.Name = "label9";
            this.label9.Size = new Size(0x35, 12);
            this.label9.TabIndex = 8;
            this.label9.Text = "已反查：";
            this.label10.AutoSize = true;
            this.label10.Location = new Point(0x4c, 0x9b);
            this.label10.Name = "label10";
            this.label10.Size = new Size(0x4d, 12);
            this.label10.TabIndex = 9;
            this.label10.Text = "已采集图片：";
            this.button1.Location = new Point(0x1c8, 0x15);
            this.button1.Name = "button1";
            this.button1.Size = new Size(0x4b, 0x17);
            this.button1.TabIndex = 10;
            this.button1.Text = "刷新";
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new EventHandler(this.button1_Click);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x22a, 0xee);
            base.Controls.Add(this.button1);
            base.Controls.Add(this.label10);
            base.Controls.Add(this.label9);
            base.Controls.Add(this.label8);
            base.Controls.Add(this.label7);
            base.Controls.Add(this.label6);
            base.Controls.Add(this.label5);
            base.Controls.Add(this.label4);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.label1);
            base.Name = "Statistics";
            this.Text = "统计";
            base.Load += new EventHandler(this.Statistics_Load);
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        private void statistics()
        {
            TradePublishDao dao = new TradePublishDao();
            int issue = dao.statisticsMaxIssue();
            int num2 = dao.statisticsCount(issue);
            int num3 = dao.statisticsGraspCount(issue);
            int num4 = dao.statisticsAntiCount(issue);
            int num5 = dao.statisticsImgCount(issue);
            this.label1.Text = ""+ issue;
            this.label2.Text = ""+num2;
            this.label3.Text = num3 + "   余:" + (num2 - num3);
            this.label4.Text = num4 + "   余:" + (num2 - num4);
            this.label5.Text = num5 + "   余:" + (num2 - num5);
        }

        private void Statistics_Load(object sender, EventArgs e)
        {
            this.statistics();
        }
    }
}

